import os

VERSION = '0.1'
EXPIRATION = 60 * 60 * 12 * 2 * 15
PER_PAGE = 10
LOGIN_ERROR_FORBID_TIME = 60
VIEW_INFO_REDIS_CACHE_EXPIRES = 60 * 10

EMAIL_SERVER = 'smtphm.qiye.163.com'
EMAIL_SENDER = 'autotest@thundersoft.com'
EMAIL_PASSWORD = 'jS2{gP3+qJ4&'  # QPsk29cn^0*

AUTURUNNER_GROUP_NAME = '成都组'
ATS_GROUP_NAME = '南京组'

PROM_NODE_INSTALL_CMD = '''
docker pull prom/node-exporter 
docker run --name node-exporter --restart=always   -d -p 9100:9100  -v /root/docker/prom/proc:/host/proc:ro  -v /root/docker/prom/sys:/host/sys:ro  -v /root/docker/prom/rootfs/:/rootfs:ro   prom/node-exporter
'''

SYS_MAP = {
    'pms': 1,
    'tams': 2,
    "auto_studio": 3,
    'stc': 4,
    'kanban': 5,
    'ats': 6,
    'otm': 7,
}

role_map = {
    'user': '普通用户',
    'admin': '管理员',
    'super_admin': '超级管理员',
    'ssa': '系统账户'
}

power_map = {
    'user': ['add_device',
             'apply_authorization',
             'default_menu'
             ],
    'admin': ['select_all_device',
              'set_authorization',
              'add_device',
              "product",
              'default_menu'
              ],
    'super_admin': ['select_all_device',
                    'set_authorization',
                    'add_device',
                    'user',
                    'set_admin',
                    "product",
                    'default_menu'
                    ],
    'ssa': [
        'apply_authorization',
        'select_all_device',
        'set_authorization',
        'add_device',
        'set_admin',
        'user',
        "product",
        'ssa',
        'default_menu'
    ]
}

role_create_map = {
    'user': [],
    'admin': ['user', 'admin'],
    'super_admin': ['user', 'admin', 'super_admin'],
    'ssa': ['user', 'admin', 'super_admin', 'ssa']
}

